package com.baymax.study.base.domain.entities;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Objects;

/**
 * ItemEntity
 *
 * @author Baymax
 * @since 2024-07-22
 */
@Data
@Entity
@Table(name = "sty_item_t")
public class ItemEntity extends BaseEntity {
    @Column(name = "item_code", columnDefinition = "varchar(32) comment '物料编码'", length = 32)
    private String itemCode;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        if (!super.equals(obj)) {
            return false;
        }
        ItemEntity that = (ItemEntity) obj;
        return Objects.equals(itemCode, that.itemCode);
    }

    @Override
    public int hashCode() {
        return super.getId().hashCode();
    }

    @Override
    public String toString() {
        return "ItemEntity{}";
    }
}
